package com.br.sae.controls;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.br.sae.model.dao.TurmaBD;
import com.br.sae.model.entitys.Turma;

public class LogicaFormTurmas implements Logica{

	@Override
	public String executa(HttpServletRequest req, HttpServletResponse res)
			throws Exception {
		List<Turma> turmas = consultaTurma();
		req.setAttribute("turmas", turmas);
		return "mostra_turma.jsp";
	}
	
	
	private List<Turma> consultaTurma(){
		TurmaBD turmaBD = new TurmaBD();
		List<Turma> turmas = turmaBD.consultaTurma();
		return turmas;

	}
	
	

}
